package ru.vpitervip.server.domain;

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.Table;

import org.springframework.roo.addon.entity.RooEntity;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.tostring.RooToString;
import org.springframework.transaction.annotation.Transactional;


@RooJavaBean
@RooToString
@RooEntity
@Table(name="metrostation")
public class MetroStation {
	
	private String rusName;

	public static List<MetroStation> findVipMetroStations() {
    	
        List<MetroStation> metroStations=entityManager().createQuery("SELECT DISTINCT o FROM Flat f JOIN f.metroStation o  WHERE f.displayMode>=4 AND f.hidden=false ", MetroStation.class).getResultList();
//        System.out.println("MetroStations:"+metroStations.size());
//        entityManager().flush();
        entityManager().clear();
        return metroStations;
   }
	
}
